$(function () {
    if (typeof (Storage)=="undefined") {
        alert("您的浏览器不支持Web Storage")
    }
    var r=$(".abs")[0].getBoundingClientRect();
    // alert(r.left);
    // alert(r.right);
    $("#midblock").css("top",r.top+"px").css("left",r.right+"px")
        .mouseenter(function(){
         $(this).css("display","block");
         // alert("into");
        }).mouseleave(function(){
    $(this).css("display", "none");
    // alert("out");
    });

    $(".menu").each(function (index) {
        $(this).mouseenter(function () {
            $("#midblock").html("");//清空内容
            $("#midblock").css("display","block");
            $.get("/C2C3",{row:index+1},function (data) {
                 content="";
                for(var i in data){
                    var vo=data[i];
                    content+="<div class='row rowtype'><div class='col-md-1 type2'><a href='/goods/getGoodsByType?c2="+vo.c2.id+"'>"+vo.c2.name+"</a></div>";
                    // alert(vo.c2.name);
                     content+="<div class='col-md-1 right'><span class='glyphicon glyphicon-chevron-right'></span></div><div class='col-md-10'>";
                    var c3s=vo.c3;
                    for (var j in c3s){
                        var c3=c3s[j];
                        content+=("<div class='col-md-1 type3'><a href='/goods/getGoodsByType?c3="+c3.id+"'>"+c3.name+"</a></div>");
                    }
                    content += "</div></div>";
                }
                $("#midblock").html(content);
            } ,"json");
        }).mouseleave(function () {
             $("#midblock").css("display","none");
        })
    })


})